package com.rent.rent_back_end.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rent.rent_back_end.dao.HomeDao;
import com.rent.rent_back_end.domain.Home;
import com.rent.rent_back_end.service.HomeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LiDongqing
 * @since 2023-02-06
 * 房源服务实现层
 */
@Service
public class HomeServiceImpl extends ServiceImpl<HomeDao, Home> implements HomeService {

    /**
     * 获取房源地址模糊查询
     * @param homeAddress 房源地址
     * @return List<Home>
     */
    @Override
    public List<Home> getAllHome(String homeAddress) {
        LambdaQueryWrapper<Home> lqw = new LambdaQueryWrapper<>();
        lqw.like(Home::getHomeAddress, homeAddress);
        return this.list(lqw);
    }
}
